/ Assembly List / LJCNetCommon / DbValue / FormatValue

Namespace - LJCNetCommon


Returns

The formatted value.

Syntax

C#
public String FormatValue()

Formats the column value for the SQL string. (D)

Remarks

Returns the string formatted value from the Value property based on the DataTypeName property.

If the DataType is Boolean, returns "1" or "0".
If the DataType is DateTime, returns a string Date or Minimum Date value.
If the DataType is string, returns a string with doubled single quotes.

Example

C#
using LJCNetCommon;

var dbValueBool = new DbValue("TestBool", "1", NetCommon.TypeBoolean);
var dbValueDate = new DbValue("TestDate", DateTime.Now()
, NetCommon.TypeDateTime);
var dbValueString = new DbValue("TestString", "string");

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.